{% extends 'base.html' %}

{% block header %}
<!-- <h1>{% block title %}Posts{% endblock %}</h1>
  {% if g.user %}
    <a class="action" href="{{ url_for('blog.create') }}">New</a>
  {% endif %} -->
{% endblock %}

{% block content %}
<div class="container">
  <div class="video_blocks">
    <div class="video_block source_video">
      <video width="400" height="300" controls="controls">
        <source src="{{ src_video }}" type="video/mp4" />
      </video>
    </div>
    <!-- <div class="convert_icon"></div>
    <div class="video_block target_video">
      <video width="400" height="300" controls="controls">
        <source src="{{ tar_video }}" type="video/avi" />
      </video>
    </div>-->
  </div>
  <div class="process_btn">
    <form action="/process" method="get">
      <input type="submit" value="检测人脸">
    </form>
    <form action="/upload" method="post" enctype="multipart/form-data">
      <input type="file" name="file" />
      <input type="submit" value="上传视频">
    </form>
  </div>

  {% for new_face in new_face_list %}
    <div class="new_face_block">
      <div class="avater"><img src="{{ new_face['face_img_path'] }}" alt=""></div>
      <form method="post" action="/addNewFace" class="new_face_form">
        <input type="hidden" name="face_json" value="{{new_face['face_json']}}" />
        <p>名称:</p><input type="text" name="new_face_name" class="new_face_form_text"/>
        <p>是否是人脸:</p><input type="radio" name="is_face" value="yes" selected class="new_face_form_radio"/>yes
        <input type="radio" name="is_face" value="no" class="new_face_form_radio"/>no
        <input type="submit"  name="submit" value="确认" class="new_face_form_btn"/>
      </form>
    </div>
  {% endfor %}

  <p>输出结果请查看facer/static/video/processed_video.mp4</p>
</div>


{% endblock %}